let list = {
    data() {
        return {
            // 表格数据
            tableData: [],
        }
    },
    created() {
        this.remoteData();
    },
    methods: {
        // 打开新增弹窗
        openSaveDialog(parentId, parentName) {
            this.$refs["updateDialog"].openSave(parentId, parentName);
        },
        // 打开编辑弹窗
        openUpdateDialog(row) {
            this.$refs["updateDialog"].openUpdate(row);
        },
        // 重新检索数据
        resetData() {
            this.$set(this.$refs["table"].store.states, "treeData", {});
            this.remoteData();
        },
        // 权限判断
        hasPermission(permission) {
            return this.user.permissionArr.includes(permission);
        },
        // 权限判断
        hasAnyPermission() {
            for (var key in this.permission) {
                if (key != "save" && this.user.permissionArr.includes(this.permission[key])) {
                    return true;
                }
            }
            return false;
        },
    }
}

export default list;